#include"sudoku.h"


int main()
{
	sudoku o;
	int original[9][9] = 
	{{0,4,0,7,0,0,0,0,0},
	 {9,2,0,0,0,0,6,0,7},
	 {8,3,0,0,0,5,4,0,0},
	 {0,1,0,0,0,3,0,0,0},
	 {0,0,0,2,0,1,0,0,0},
  	 {0,0,0,5,0,0,0,4,0},
	 {0,0,4,9,0,0,0,7,1},
	 {3,0,5,0,0,0,0,9,4},
	 {0,0,0,0,0,8,0,6,0}};
	for(int i=0; i<9; i++)
		for(int j=0; j<9; j++)
		{
			if(original[i][j])
			{
				
				if(!o.setNum(i, j, original[i][j]))
				{
					cout<<"Wrong Exercise!!"<<endl;
					exit(0);
				}
				
			}
		};
	o.setAdd();
	
	while(!o.isProgramOver())
	{
		sudoku tr1 = o;
		if(tr1.trial(1))
			o = tr1;
		else 
		{
			sudoku tr2 = o;
			if(tr2.trial(2))
				o = tr2;
		}
	}
	o.print();

}